<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/static/lib/html5shiv.js"></script>
<script type="text/javascript" src="/static/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户详情</title>
<link href="/static/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户管理 <span class="c-gray en">&gt;</span>用户列表<span class="c-gray en">&gt;</span> 用户详情
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<form action="{{ url('operation:user_change', args=(userinfo.id)) }}" method="get" id="form">
<div class="page-container">
       <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">头像：</label>
			<div class="formControls col-xs-8 col-sm-9">
　　       <div id="test-image-preview"></div>
                <img style="width: 60px;height: 60px;margin-top: -20px;margin-bottom: 10px;" src="{{ userinfo.headimgurl }}">
			</div>
		</div>

        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">昵称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{{userinfo.nickname}}" placeholder="" id="bond_money" name="" disabled>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{{userinfo.name}}" placeholder="" id="name" name="name">
			</div>
		</div>
  <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">性别：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <span class="select-box">
                    <select name="" class="select" id="bussiness_style" disabled>
                        <option value="1" {% if userinfo.sex==1 %}selected{% endif %}>男</option>
                        <option value="2" {% if userinfo.sex==2 %}selected{% endif %}>女</option>
                        <option value="3" {% if userinfo.sex==0 %}selected{% endfi %}>未知</option>
                    </select>
                    </span>
                </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">电话号码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{{userinfo.phonenumber}}" placeholder="" id="phonenumber" name="phonenumber">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">openid：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{{ userinfo.openid}}" placeholder="" id="bussiness_jing" name="" disabled>
			</div>
		</div>

     <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2">在读图书</label>
            <div class="formControls col-xs-8 col-sm-9">
            <table class="table table-border table-bordered table-bg">
            <thead>
                <tr>
                    <th scope="col" colspan="5"><div style="float: left">在读图书</div>
                </tr>
                <tr class="text-c">
                    <th width="40">书名</th>
                    <th width="150">借书时间</th>
                    <th width="90">状态</th>
                </tr>
            </thead>
            <tbody>
            {% for line in borrow_list %}
                <tr class="text-c">
                    <td>{{line.book.name }}</td>
                    <td>{{ line.borrow_time }}</td>
                    <td>{% if line.status==1 %} 在读 {% else %} 已还 {% endif %}</td>
                </tr>
            {% endfor %}
            </tbody>
           </table>
             </div>
         </div>

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onclick="do_change();" class="btn btn-primary radius" type="button" id="btn"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
				<button onclick="layer_close()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
</div>
</form>

<script>
    var name = "{{ userinfo.name }}"
    var phonenumber = "{{ userinfo.phonenumber }}"
    function layer_close() {
        document.getElementById('name').value = name;
        document.getElementById('phonenumber').value = phonenumber;
    }
    function do_change() {
        document.getElementById('form').submit();
    }
</script>


<!--_footer 作为公共模版分离出去-->


<script type="text/javascript">
      $(function(){
          $("#test-image-file1").val("https://imgsa.baidu.com/exp/w=480/sign=581bd10a0bf3d7ca0cf63e7ec21fbe3c/cb8065380cd7912357e40240aa345982b2b780fa.jpg")
      })

      $("#btn").click(function () {
           var imgurl = document.getElementById("test-image-file1").files[0];
           var form = new FormData();
           form.append("business_id",$("#business_id").val());
           form.append("imgurl",imgurl);
           form.append("bussiness_style",$("#bussiness_style").val());
           form.append("bond_money",$("#bond_money").val());
           form.append("bussiness_name",$("#bussiness_name").val());
           form.append("bussiness_phone",$("#bussiness_phone").val());
           form.append("bussiness_way",$("#bussiness_way").val());
           form.append("bussiness_jing",$("#bussiness_jing").val());
           form.append("bussiness_wei",$("#bussiness_wei").val());
           form.append("bussiness_pu",$("#bussiness_pu").val());
           form.append("bussiness_dala",$("#bussiness_dala").val());
           form.append("bussiness_bonus",$("#bussiness_bonus").val());
　      $.ajax({
                url:"/operation/bussiness_add/",
                type:"post",
                data:form,
                processData:false,
                contentType:false,
                success:function(data){
                    window.location.href="/operation/bussiness_list/?id="+data;
                }
            });

         })
</script>
</body>
</html>